/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.tspp.dao.dto;

import java.io.Serializable;

/**
 * Transfer object for Groupa table(DAO pattern)
 * @author Maks
 */
public class Groupa implements Serializable {

    /** This attribute maps to the column ID_GROUP in the GROUPA table.*/
    private int idGroup;

    /**  This attribute maps to the column ID_SPECIALITY in the GROUPA table.*/
    private int idSpeciality;

    /** This attribute maps to the column MAX_STUDENTS_NUMBER in the GROUPA table.*/
    private int maxStudentsNumber;

    /** This attribute maps to the column CODE in the GROUPA table.*/
    private String code;

    /**
     * Return value of the column ID_GROUP in the GROUPA table
     * @return int
     */
    public int getIdGroup() {
        return idGroup;
    }

    /**
     * Set id of the group
     * @param idGroup
     */
    public void setIdGroup(int idGroup) {
        this.idGroup = idGroup;
    }

    /**
     * Return value of the column ID_SPECIALITY in the GROUPA table
     * @return int
     */
    public int getIdSpeciality() {
        return idSpeciality;
    }

    /**
     * Set id of speciality
     * @param idSpeciality
     */
    public void setIdSpeciality(int idSpeciality) {
        this.idSpeciality = idSpeciality;
    }

    /**
     * Return value of the column MAX_STUDENTS_NUMBER in the GROUPA table
     * @return int
     */
    public int getMaxStudentsNumber() {
        return maxStudentsNumber;
    }

    /**
     * set value of maxStudentsNumber
     * @param maxStudentsNumber
     */
    public void setMaxStudentsNumber(int maxStudentsNumber) {
        this.maxStudentsNumber = maxStudentsNumber;
    }

    /**
     * Return value of the column CODE in the GROUPA table
     * @return String
     */
    public String getCode() {
        return code;
    }

    /**
     * set value of group code
     * @param code
     */
    public void setCode(String code) {
        this.code = code;
    }

    /**
     * Method 'equals'
     *
     * @param _other
     * @return boolean
     */
    @Override
    public boolean equals(Object _other) {
        if (_other == null) {
            return false;
        }

        if (_other == this) {
            return true;
        }

        if (!(_other instanceof Groupa)) {
            return false;
        }

        final Groupa _cast = (Groupa) _other;
        if (idGroup != _cast.idGroup) {
            return false;
        }

        if (idSpeciality != _cast.idSpeciality) {
            return false;
        }

        if (maxStudentsNumber != _cast.maxStudentsNumber) {
            return false;
        }

        if (code == null ? !_cast.code.equals(code) : !code.equals(_cast.code)) {
            return false;
        }

        return true;
    }

    /**
     * Method 'hashCode'
     *
     * @return int
     */
    @Override
    public int hashCode() {
        int _hashCode = 0;
        _hashCode = 29 * _hashCode + idGroup;
        _hashCode = 29 * _hashCode + idSpeciality;
        _hashCode = 29 * _hashCode + maxStudentsNumber;
        if (code != null) {
            _hashCode = 29 * _hashCode + code.hashCode();
        }

        return _hashCode;
    }
    /**
     * Method 'toString'
     *
     * @return String
     */
    @Override
    public String toString() {
        StringBuilder ret = new StringBuilder();
        ret.append("com.tspp.dao.dto.Groupa: ");
        ret.append("idGroup=").append(idGroup);
        ret.append(", idSpeciality=").append(idSpeciality);
        ret.append(", maxStudentsNumber=").append(maxStudentsNumber);
        ret.append(", code=").append(code);
        return ret.toString();
    }
}
